package com.lpinfo.spb.framework.exception;

import com.lpinfo.spb.framework.base.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GloabalExceptionHandler {

	@ExceptionHandler(Exception.class)
	public ResponseData exceptionHandler(Exception e){
		return  ResponseData.error(e.getMessage());
	}

//	@ExceptionHandler(ExpiredJwtException.class)
//	public ResponseEntity handleExpiredJwtException(ExpiredJwtException e){
//		logger.error(e.getMessage(), e);
//		return new ResponseEntity(false, StatusCode.ERROR, "token失效，请重新登录!");
//	}
}
